Skip to content

feat(skills/opening-a-pull-request): document keyword and linkage semantics for stacked retargeted PRs#26

Merged
sourcehawk merged 3 commits into
mainfrom
feat/stacked-pr-keyword-linkage
Jul 10, 2026
Merged

feat(skills/opening-a-pull-request): document keyword and linkage semantics for stacked retargeted PRs#26
sourcehawk merged 3 commits into
mainfrom
feat/stacked-pr-keyword-linkage

Conversation

@sourcehawk

Copy link
Copy Markdown
Owner

Problem

The skill's keyword table covers PRs targeting main and PRs targeting a feature branch, but not the stacked shape in the sub_pr_target: main model: a draft that opens against its parent sub-branch (so its diff shows only its own commits) and retargets to main when the parent merges. The silence forces every session to derive its own policy, and the two coherent derivations disagree — a baseline agent derived Towards with a manual upgrade at every retarget (whose forgotten upgrade means the sub-issue never auto-closes), while a live session used Closes from the start and then had to diagnose why the epic's sub-issues showed no linked PR (the user asked; the answer — closing-keyword linkage only materializes on default-branch-base PRs — was nowhere in the skill).

Change

skills/opening-a-pull-request/SKILL.md gains a third branch-target bullet: use the type-appropriate closing keyword from the start (it describes the eventual main merge and survives the retarget with no body edit), with the deferral fact spelled out (no linked-PR association and no auto-close while the base is a sibling branch — deferred, not broken) and a retarget-time verification (gh pr view --json closingIssuesReferences, re-save the body if empty). One matching red-flag row for the "no linked PR, the keyword must be wrong" misdiagnosis.

Verification (writing-skills RED → GREEN)

  • RED: a baseline agent given the unmodified skill derived the Towards-then-upgrade policy and itself flagged its failure mode; the live session's Closes-from-the-start choice produced user-visible confusion the skill couldn't explain.
  • GREEN: with the edit, the same scenario yields Closes from the start, the correct deferred-not-broken explanation for the missing linkage (declining to "fix" it), and the retarget-time closingIssuesReferences check with the body re-save fallback.

Copilot AI review requested due to automatic review settings July 4, 2026 03:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the opening-a-pull-request skill to explicitly cover stacked, retargeted sub-PRs (drafts opened against a parent/sibling branch, then later retargeted to main) so agents apply consistent closing-keyword semantics and correctly interpret deferred GitHub issue linkage behavior.

Changes:

  • Adds guidance for stacked sub-PRs that temporarily target a sibling branch, recommending using Fixes/Closes from the start and explaining the “deferred until retarget” linkage behavior.
  • Adds a retarget-time verification step using gh pr view --json closingIssuesReferences and a re-save fallback if linkage doesn’t materialize.
  • Adds a red-flag row to prevent misdiagnosing “no linked PR” as an incorrect keyword while the PR is not yet based on the default branch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/opening-a-pull-request/SKILL.md Outdated
… in the red-flag row's verification command

The row's command omitted <num> while the body text includes it; without the number the command depends on the checked-out branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J1vgUwZZpzavETACT3fXPM
Copilot AI review requested due to automatic review settings July 10, 2026 07:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread skills/opening-a-pull-request/SKILL.md Outdated
Comment thread skills/opening-a-pull-request/SKILL.md
…s in the stacked-PR bullet

Matches the placeholder form the main-target bullet uses.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J1vgUwZZpzavETACT3fXPM
Copilot AI review requested due to automatic review settings July 10, 2026 08:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@sourcehawk sourcehawk merged commit fa6aa0c into main Jul 10, 2026
1 check passed
@sourcehawk sourcehawk deleted the feat/stacked-pr-keyword-linkage branch July 10, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants